<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css"
	href="//at.alicdn.com/t/font_388406_7mrmxzvj69psc3di.css">
<link rel="stylesheet" type="text/css" href="../css/common.css">
</head>
<body>
	<#import "/page.ftl" as page />
	<link rel="stylesheet" type="text/css" href="../css/public.css">
	<script type="text/javascript" src="/js/mail.js"></script>
	<!-- body大盒子div开始 -->
	<div class="body">
		<!-- content-header顶部div 开始 -->
		<#include "/head.ftl"/>
		<!-- 中部content div开始 -->
		<div class="content">
			<!-- 中部content内容 div开始 -->
			<div class="row">
				<div class="row-left">
					<a href="/mail/addmail" title="添加邮件"
						class="btn btn-upload bgColor-green2 margin-bottom button"
						style="margin: 0 0 20px 0"> <i
						class="iconfont icon-brush_fill" style="color: white;"></i> 写信
					</a>
					<div class="box box-solid">
						<div class="box-header with-border">
							<h3 class="box-title">文件夹</h3>
							<div class="box-tools">
								<button class="btn btn-box-tool jian" onclick="jian()">
									<i class="iconfont icon-jian" id="one"></i>
								</button>
							</div>
						</div>
						<div class="box-body no-padding yunpan" style="display: block;">
							<ul class="nav nav-pills nav-stacked">
								<li><a class="get-box"> <i
										class="iconfont icon-shoujianxiang"></i> <span>收件箱</span>
								<span class="mail-num uniquebackground">${(mailnum)!''}</span>		
								</a>
								
								</li>
								<li><a class="send-box"> <i
										class="iconfont icon-fajianxiang-copy"></i> <span> 发件箱</span>
								</a></li>
								<li><a class="graft-box"> <i
										class="iconfont icon-caogaoxiang"></i> <span> 草稿箱</span>
								</a></li>
								<li><a class="gabege-box"> <i
										class="iconfont icon-lajixiang"></i> <span> 垃圾箱</span>
								</a></li>
								<!-- <li><a class="" href="javascript:void(0)"> <i
										class="iconfont icon-huishouzhan"></i> <span> 回收站</span>
								</a></li> -->
							</ul>
						</div>
					</div>
					<div class="box box-solid">
						<div class="box-header with-border">
							<h3 class="box-title">类型</h3>
							<div class="box-tools">
								<button class="btn btn-box-tool" onclick="jian2()">
									<i class=" iconfont icon-jian " id="two"></i>
								</button>
							</div>
						</div>

						<div class="box-body no-padding leixing" style="display: block;">
							<ul class="nav nav-pills nav-stacked">
								<li class="father-menu"><a class="email-star"> <i
										class="iconfont icon-circle1 "></i>星标邮件
								</a></li>
								<!-- <li>
									<a href="#">
										<i class="iconfont icon-circle1"></i> 通知
									</a>
								</li>
								<li>
									<a href="#">
										<i class="iconfont icon-circle1" style="color:red;"></i> 公告
									</a>
								</li> -->
							</ul>
						</div>

					</div>
				</div>
				<!-- 右部div盒子开始 -->
				<div class="row-right">
					<div class="box tab">
						<!-- <div class="box-header with-border">
							<h3 class="box-title">
								<span>收件箱</span>
							</h3>
							
						</div> -->
						<div class="tab-header">
							<div class="mailbox-controls">
								<a title="全选/反选" class="btn btn-setting checkbox-togger"
									style="margin-right: 10px;"> <i
									class="iconfont icon-weibiaoti--"></i>
								</a> 
								
								<a path="${(href)!''}" class="btn btn-setting btn-delete btn-delete-many"> <i
									class="iconfont icon-trash"></i>	
								</a>					 
								<a  title="已读" class="btn btn-setting btn-isread">
									<i class="iconfont icon-browse"></i>
								</a> <a href="javascript:void(0)" title="星标"
									class="btn btn-setting star-togger"> <i
									class="iconfont icon-collection"></i>
								</a> <a title="刷新" class="btn btn-setting"
									style="margin-left: 10px;" onclick="refresh(this)"> <i
									class="iconfont icon-refresh"></i>
								</a>
								<div class="tab-tool" >
									<input class="search-input"  type="text" placeholder="查找..."> <a
									 path="${(href)!''}" class="search-btn"> <i class="iconfont icon-search"></i>
									</a>
								</div>
							</div>
							<div class="tab-content email-table">
								<table class="table table-hover table-striped" cellspacing="0"
									border="0"
									style="border-width: 0px; border-collapse: collapse;">
									<thead>
										<tr>
											<th scope="col">选择</th>
											<#if box == "0"||box="1"||box="3">
												<th scope="col">&nbsp;</th>
												<#else>																					
											</#if>					
											<!-- <th scope="col"><a href="#">类型</a></th> -->
											<#if box == "0">
												<th scope="col">发件人</th>
												<#elseif box == "1">
												<th scope="col">收件人</th>
												<#elseif box=="3" ||box=="2">
												<th scope="col">类型</th>							
											</#if>
											<th scope="col">主题</th>
											<th scope="col">时间</th>
											<th scope="col">附件</th>
											<th scope="col">状态</th>
											<th scope="col" width="25%">操作</th>
										</tr>
									</thead>
									<tbody>
										<#list (maillist.content?sort_by("emTime")?reverse) as mail>
										<tr>
											<td>
												<div onclick="select(this)" dataid="${mail.emId}"
													class="icheckbox icheckbox_flat-green" aria-checked=false
													style="position: relative;">
													<input type="checkbox"
														style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;">
													<ins class="iCheck-helper"
														style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
												</div>
											</td>
											<#if box=="0"||box=="1"||box=="3">
												<td class="mailbox-star"><a dataid="${mail.emId}"
												class="star-icon" onclick="isCollection(this)" title="标记星标">
													<#if mail.emStar==0> <i
														class="iconfont icon-collection"></i> <#elseif
														mail.emStar==1> <i
														class="iconfont icon-collection_fill"></i></#if>
												</a>
												</td>
												<#else>
											</#if>										
											<!-- <td><span>邮件</span></td> -->
											<#if box=="3" ||box=="2">
												<#if mail.emEsId==0>
													<td><span>收件箱</span></td>
													<#elseif mail.emEsId==1>
													<td><span>发送箱</span></td>
													<#elseif mail.emEsId==2>
													<td><span>草稿箱</span></td>
												</#if>
											</#if>
											<#if mail.emEsId==0 >
												<#if box!="3" && mail.emIsDelete==0>
													<td><span>${mail.senduser.realName}</span></td>
												</#if>
											<td>
											<!-- 判断是否已读 -->
											<#if mail.emIsRead==0>
												 <span class="email-tittle" style="font-weight: 700">
													${(mail.emTitle)!''}
												</span> 
												<#elseif mail.emIsRead==1>
												 <span>${(mail.emTitle)!''}</span>
											</#if>
											</td>											
											<!-- 判断是发件相还是收件相 -->
											<#elseif mail.emEsId== 1 || mail.emEsId==2>
											<#if box=="0"||box=="1">
												<td>
													<div style="text-overflow: ellipsis; white-space: nowrap; width: 100px; overflow: hidden; margin: 0 auto;">
														<#if mail.emgetusername??>
															<span>${mail.emgetusername}</span>
															<#else>
															<span>${mail.getuser.realName}</span>
														</#if>
														
													</div>
												</td>
												<#else>
											</#if>
												<td>
													<span>${(mail.emTitle)!''}</span>
												</td>										
											</#if>
											<td><span style="color: #999;">${mail.emTime}</span></td>
											<td>
											<#if mail.attid!=0>
												<a href="javascript:void(0)" title="附件"><span> <i class="iconfont icon-accessory"></i></span></a>
												<#else>										
											</#if>
											</td>
											<td>
												<#list status as sta>
													<#if mail.emStatus==sta.value>
														<span class="btn" style="background:${sta.color} ">
															${sta.name}
														</span>
													</#if>		
												</#list>								
											</td>
											<td>
											<#if mail.emEsId==0>
												<a class="btn btn-look viewmail-btn" dataid="${mail.emId}"><i class="iconfont icon-search"></i><span> 查看</span></a>
												<#else>
												<a class="btn btn-look email-edit" dataid="${mail.emId}"><i class="iconfont icon-search"></i><span> 查看</span></a>
											</#if>
											<#if href??>
												<a class="btn btn-delete  email-delete-icon" dataid="${mail.emId}" path="${href}"> <i
													class="iconfont icon-trash"> </i> <span>删除</span>
											</a> 
											</#if>
											<#if box="1" ||box="3">
												<a class="btn btn-update email-edit" dataid="${mail.emId}"><i class="iconfont icon-brush"></i><span>再次编辑发送</span>
												</a>
											<#else>
											</#if>
											</td>
										</tr>
										</#list>

									</tbody>
								</table>
							</div>
						</div>
						<@page.page url=requestURI pager=maillist />
						<!-- <div class="box-footer no-padding" style="margin-top: -20px;">
							<div class="mailbox-controls">
								<div id="pager"
									style="background: #fff; border: 0px; margin-top: 0px; padding: 2px;">
									<div class="Page">
										<div class="CustomInfo" style="width: 40%; float: left;">

										</div>
									</div>
								</div>
							</div>
						</div> -->
						<!-- 右部div盒子开始 -->
					</div>
					<!-- 中部content内容 div结束 -->
				</div>

				<!-- 中部content div结束-->
			</div>
			<!-- body大盒子div结束 -->
		</div>
	</div>
</body>
</html>